<!DOCTYPE HTML />
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>填写报名资料</title>
    <link href="/css/main.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/css/jquery.ui.core.css" type="text/css"/>
    <link rel="stylesheet" href="/css/jquery.ui.theme.css" type="text/css"/>
    <link rel="stylesheet" href="/css/fileuploader.css" type="text/css"/>
    <?php include_once("common/common_js.php") ?>
    <link rel="stylesheet" href="/css/jquery.ui.datepicker.css" type="text/css"/>
    <script src="/js/jquery.ui.core.min.js"></script>
    <script src="/js/jquery.ui.datepicker.js"></script>
    <script src="/js/fileuploader.js"></script>
    <script>

        $(function() {
            $("#birthDay").datepicker({dateFormat:"yy-mm-dd"});
            var uploader = new qq.FileUploader({
                // pass the dom node (ex. $(selector)[0] for jQuery users)
                element: document.getElementById('upload'),
                button:null,
                // path to server-side upload script
                action: '/index.php/ajax/upload',
                allowedExtensions: ["jpg", "png", "gif"],
                multiple:true,
// each file size limit in bytes
// this option isn't supported in all browsers

// set to true to output server response to console
                debug: false,
                onProgress: function(id, fileName, loaded, total) {
                },
                onComplete: function(id, fileName, responseJSON) {
                    $("#picturePreview").attr("src", responseJSON.url);
                    $("#picture").val(responseJSON.url);
                    $("#upload").text("已成功上传");
                    return false;
                },
                onCancel: function(id, fileName) {
                },

                messages: {
                    // error messages, see qq.FileUploaderBasic for content
                }
            });
        });
    </script>
</head>
<body>
<?php include_once("common/banner.php"); ?>

<div class="warpper">
    <?php include_once("common/header.php"); ?>
    <div class="part_a " style="height:10px;"></div>
    <div>

        <form action="/index.php/user/addApplication" name="form1" method="post">
            <?php if (isset($this->_post['button']) && $this->_post['button'] == "保存") { ?>
            <p style="font-size: 18px; color:red">报名成功</p>
            <?php }?>
            <input name="voteId" value="1" type="hidden"/>
            <?php if (isset($view['application'])) {
            echo "<input type='hidden' name = 'applicationId' value='" . $view['application']['applicationId'] . "' />";
        } ?>
            <input name="photo" id="picture"  value="<?php echo  $view['application']['photo']  ?>" type="hidden"/>
            <table>
                <!--<tr>
                    <td>我的总票数</td>
                    <td><?php
/*                         $userVote = $this->modules->UserVote;
                        echo $userVote->findCountByUserId($view['application']['applicationId'] == "" ? 0
                                                                  : $view['application']['applicationId'], 1);
                        */?></td>
                </tr>-->
                <tr>
                    <td width="80">姓名</td>
                    <td width="350"><input type="text" <?php if ($view['user']['realName'] != "") {
                        echo "readonly=\"readonly\"  value='" . $view['user']['realName'] . "'";
                    }?>
                                           name="name" class="f_txt"/></td>
                    <td rowspan="6" style="text-align:center;">
                        <img src="<?php echo  $view['application']['photo'] == '' ? $view['user']['avatar']==''?'/images/temp.png':$view['user']['avatar']
                                : $view['application']['photo']  ?>" id="picturePreview"
                             style="width:190px;margin-top:10px;"/>

                        <div style="clean:both">&nbsp;</div>
                        <a id="upload" style="margin-top:8px;">上传头像</a>
                    </td>
                </tr>
                <tr>
                    <td>昵称</td>
                    <td><input type="text" name="nickname" <?php if ($view['user']['nickName'] != "") {
                        echo "readonly=\"readonly\"  value='" . $view['user']['nickName'] . "'";
                    }?>
                               class="f_txt"/></td>
                </tr>
                <tr>
                    <td>姓别</td>
                    <td>
                        <?php if ($view['user']['gender'] != "") { ?>
                        <input type="text" name="nickname" readonly="readonly"
                               value='<?php echo $view['user']['gender'] ?>' class="f_txt"/>
                        <?php } else { ?>
                        <select name="gender">
                            <option <?php if ($view['application']['gender'] == "男") echo "selected" ?> value="男">男
                            </option>
                            <option <?php if ($view['application']['gender'] == "女") echo "selected" ?> value="女">女
                            </option>
                        </select>
                        <?php } ?></td>
                </tr>
                <tr>
                    <td>生日</td>
                    <td><input type="text" name="birthday" id="birthDay"
                               value="<?php echo $view['application']['birthday'] ?>" class="f_txt"/></td>
                </tr>
                <tr>
                    <td>爱好</td>
                    <td><input type="text" name="hobby" value="<?php echo $view['application']['hobby'] ?>"
                               class="f_txt"/></td>
                </tr>
                <tr>
                    <td>个性签名</td>
                    <td><input type="text" name="motto" value="<?php echo $view['application']['motto'] ?>"
                               class="f_txt"/></td>
                </tr>
                <tr>
                    <td>自我简介</td>
                    <td><textarea name="introduce"
                                  style="width:400px;height:200px"><?php echo $view['application']['introduce'] ?></textarea>
                    </td>
                </tr>
                <tr>
                    <td>身高</td>
                    <td><input type="text" name="height" value="<?php echo $view['application']['height'] ?>"
                               class="f_txt"/>（单位:厘米）
                    </td>
                </tr>
                <tr>
                    <td>体重</td>
                    <td><input type="text" name="weight" value="<?php echo $view['application']['weight'] ?>"
                               class="f_txt"/>（单位:公斤）
                    </td>
                </tr>
                <tr>
                    <td>三围></td>
                    <td>胸围:<input type="text" name="bust" value="<?php echo $view['application']['bust'] ?>"
                                  class="f_txt" style="width: 50px;"/>
                        腰围:<input type="text" name="waistline"
                                  value="<?php echo $view['application']['waistline'] ?>" class="f_txt"
                                  style="width: 50px;"/>
                        臀围:<input type="text" class="f_txt" value="<?php echo $view['application']['bust'] ?>"
                                  name="bust" style="width: 50px;"/>
                    </td>
                </tr>

                <tr>
                    <td></td>
                    <td>
                        <input type="submit" name="button" value="提交" class="f_btn"/>
                    </td>
                </tr>
            </table>
        </form>

    </div>
    <?php include("common/footer.php"); ?>
</div>
<!--大赛的内容简介-->

</body>
</html>